REM goto :BuildRes
@ECHO OFF

REM Set Format Parameter for GENDATA.EXE
if %SP_HW%. ==SDS. @set FMT=-s
if %SP_HW%. ==ADS. @set FMT=-A

@echo *******************
@echo Creating FIELDS.INI
@echo *******************
if exist fields.ini del fields.ini
if %SP_HW%. ==ADS. type fieldsxa.ini >> fields.ini
if %SP_HW%. ==SDS. type fieldsx.ini >> fields.ini
if %SP_HW%. ==ADS. @echo ARM >> fields.ini

if %SP_HW%. ==SDS. @set ROOT_DIR=verixaps
if %SP_HW%. ==ADS. @set ROOT_DIR=verixvaps

if %SP_HW%. ==SDS. @set SDK_ROOT_DIR=verixaps
if %SP_HW%. ==ADS. @set SDK_ROOT_DIR=verixvaps

if %SP_HW%. ==SDS. @set SDK_SUB_ROOT_DIR=vfsdk
if %SP_HW%. ==ADS. @set SDK_SUB_ROOT_DIR=vrxsdk

REM Duplicated in MMData.BAT From Here

rem "%SP_DRIVE%\\VerixAps\\SOFTPAY\\%SP_VER%\\projects\\%SP_PROJ%\\config\\%SP_HW%" >> fields.ini

rem @echo   "C&MK_DIRECTORY" "%SP_DRIVE%\\VerixAps\\SOFTPAY\\%SP_VER%\\projects\\%SP_PROJ%\\config\\%SP_HW%" >> fields.ini
@echo COMMON_INCLUDES "\\SOFTPAY\\%SP_VER%\\source\\include\\sizes.h", "\\SOFTPAY\\%SP_VER%\\HostSrc\\citisrc\\citiids.h", "\\SOFTPAY\\%SP_VER%\\HostSrc\\cpacsrc\\cpacids.h" >> fields.ini
@echo include_directory "%SP_DRIVE%\\SOFTPAY\\%SP_VER%\\source\\include" >> fields.ini
@echo GDXXXFLD.H_DIRECTORY "\\SOFTPAY\\%SP_VER%\\projects\\%SP_PROJ%\\config\\%SP_HW%" >> fields.ini
@echo H_DIRECTORY "%SP_DRIVE%\\SOFTPAY\\%SP_VER%\\source\\include" >> fields.ini
@echo XXXFLD.H_DIRECTORY "\\SOFTPAY\\%SP_VER%\\projects\\%SP_PROJ%\\config\\%SP_HW%" >> fields.ini
@echo DEFINE_INCLUDES  "\\SOFTPAY\\%SP_VER%\\Source\\Include\\project.h", "\\%SDK_ROOT_DIR%\\%SDK_SUB_ROOT_DIR%\\%SDK_VER%\\Include\\svc.h", "\\SOFTPAY\\%SP_VER%\\source\\include\\define.h", "\\SOFTPAY\\%SP_VER%\\Source\\Include\\comm.h" >> fields.ini

@echo OBJ_DIRECTORY "\\SOFTPAY\\%SP_VER%\\Projects\\%SP_PROJ%\\obj\\%SP_HW%" >> fields.ini
@echo LIB_DIRECTORY "\\SOFTPAY\\%SP_VER%\\Projects\\%SP_PROJ%\\lib\\%SP_HW%" >> fields.ini
@echo SDS_INCLUDE "\\%SDK_ROOT_DIR%\\%SDK_SUB_ROOT_DIR%\\%SDK_VER%\\include" >> fields.ini
@echo ACT_INCLUDE "\\%ROOT_DIR%\\act2000\\%ACT_VER%\\include" >> fields.ini
echo on


echo off

@echo SOURCE_DIRECTORY "\\SOFTPAY\\%SP_VER%\\source" >> fields.ini

@echo build_directory "\\SoftPay\\%SP_VER%\\Output\\%SPOUTDIR%\\%SP_HW%\\Files" >> fields.ini
@echo built_message_directory "\\SoftPay\\%SP_VER%\\Output\\%SP_HW%\\%SPOUTDIR%\\Files" >> fields.ini
@echo out_directory "\\SoftPay\\%SP_VER%\\Output\\%SPOUTDIR%\\%SP_HW%\\Download" >> fields.ini
REM Duplicated in MMData.BAT To Here

@echo in_file %PROJ_ALLIN% >> fields.ini
@echo data_file %PROJ_DATAIN% >> fields.ini

rem @echo in_file "all.in" %PROJ_ALLIN% >> fields.ini
rem @echo data_file "data.all" %PROJ_DATAIN% >> fields.ini

@echo batch_directory "\\SOFTPAY\\%SP_VER%\\projects\\%SP_PROJ%\\bld" >> fields.ini
@echo XXX.TXT_DIRECTORY "\\SOFTPAY\\%SP_VER%\\projects\\%SP_PROJ%\\config\\%SP_HW%\\TXT" >> fields.ini
@echo XXXFLD.TXT_DIRECTORY "\\SOFTPAY\\%SP_VER%\\projects\\%SP_PROJ%\\config\\%SP_HW%\\FLD" >> fields.ini
@echo MESSAGE_FILE_DIRECTORY "\\SOFTPAY\\%SP_VER%\\projects\\%SP_PROJ%\\config\\%SP_HW%\\MSG" >> fields.ini

type fields.ini
 
@echo ***************************
@echo GENERATING TABLE DATA FILES
@echo ***************************
set classpath=%classpath%;%SERF%\%SERF_VER%\Tool\SoftPayFields.zip
REM set classpath=%classpath%;%SP_ROOT%\projects\%SP_PROJ%\bld\SoftPayFields.zip
java SoftPayFields fields.ini



@echo ***************************
@echo Build SoftPay Resource File
@echo ***************************
:BuildRes
%SPTOOLS%\rck2 -S%SRC_ROOT%\VMAC\softpay -O%SPFILES%\softpay -M
REM goto :End
REM @Echo Replace *FLD.txt NOW! 
REM goto :End

@echo ****************************
@echo Build Conforming Table .DATs
@echo ****************************
rem @call BuildDAT.bat
rem @echo Create C01.DAT for Lynk Download RE: SPA Download and Express Config
rem copy %SPFILES%\cdt.dat %SPFILES%\c01.dat

@cd %SP_ROOT%\Projects\%SP_PROJ%\Bld

@call cdat.bat

@call cfld.bat

REM  Perform SERF processing if necessary
if %SP_SERF%. ==. goto :NOSERF
@call serf.bat
:NOSERF

@echo *************************************
@echo GENERATING ENGLISH MESSAGE DATA FILES
@echo *************************************

@set LANGUAGE=engl
@set LANG1=e

@call tpl.bat

@call langdat.bat

@call msg.bat


@echo *********************************
@echo DATA FILES GENERATED FOR TERMINAL
@echo *********************************

:End
rem @set FMT=
rem @set LANGUAGE=
rem @set LANG1=
